package cn.ad.server.web.spring.model.adview;

import cn.ad.server.domain.enumration.AdFormat;

import java.util.HashMap;
import java.util.Map;

/**
 * @author dongbin.yu
 * @from 2016-07-19
 * @since V1.0
 */
public enum AdViewFormat {

    BANNER(0, AdFormat.BANNER),
    TABLE_SCREEN(1, AdFormat.TABLE_SCREEN),
    OPEN_SCREEN(4, AdFormat.OPEN_SCREEN),
    AD_NATIVE(6, AdFormat.AD_NATIVE);

    private int value;
    private AdFormat adFormat;

    public final static Map<Integer, AdFormat> FORMAT_MAP = new HashMap<>();

    static {
        for (AdViewFormat adViewFormat : values()) {
            FORMAT_MAP.put(adViewFormat.getValue(), adViewFormat.getAdFormat());
        }
    }


    AdViewFormat(int value, AdFormat adFormat) {
        this.value = value;
        this.adFormat = adFormat;
    }

    public int getValue() {
        return value;
    }

    public AdFormat getAdFormat() {
        return adFormat;
    }
}
